<template>
	<div class="app-container" id="step4">

		<!-- 帮助引导 -->
		<guidance class="stepBtn" title="帮助引导" :list="helpList"></guidance>

		<div class="textCenter">
			<div class="tableBox">
				<div class="topBox inlinBlock">
					<label class="el-form-item__label" style="width: 240px;">手动切换前是否强制做全量同步:</label>
					<el-switch v-model="fullTransferEnabled" active-color="#13ce66" inactive-color="#ff4949">
					</el-switch>
				</div>
				<div class="topBox inlinBlock">
					<label class="el-form-item__label" style="width: 210px;">是否开启增量数据同步:</label>
					<el-switch v-model="dataMonitorEnabled" active-color="#13ce66" inactive-color="#ff4949">
					</el-switch>
				</div>
				
				<br>
					
					<div class="flexBox tipTxt">
						<div class="l"><i class="el-icon-message-solid warning" ></i>提示：</div>
						<div class="r ">
							<div>1、数据同步目录配置可参照复刻任务快捷同步，可在“参照复刻任务”下拉框选择；</div>
							<div>2、自定义数据同步目录配置，请点击“同步目录”、“排除目录”按钮配置；</div>
							<div>3、手动切换前请按照全量同步、增量同步顺序执行切换，验证目标机是否正常；</div>
						</div>
					</div>
				
			</div>
		</div>
		<!-- 通过进程的方式选择目录，继续调研有困难暂时注释，后期有可能会用 -->
		<!-- <div class="tableBox">
			<div class="topBox inlinBlock">
				<label class="el-form-item__label" style="width: 140px;">同步类型:</label>
				<el-radio-group v-model="dataType" @change="dataTypeFn" >
				    <el-radio label="1">进程</el-radio>
				    <el-radio label="2">目录</el-radio>
				  </el-radio-group>
			</div>
		</div> -->
		
		<div class="tableBox">
			<!-- <el-tabs v-model="dataType" tab-position="left" style="height: 380px;">
			  <el-tab-pane label="进程" name="1" >
				  <div class="pathBox">
				  	  	<div class="leftBox">
				  	  
				  	  		<div class=" transferk miniTabDiv">
				  	  		
									<div class="treeBox">
										<el-input
											class="elIpt"
											size="small"
										  placeholder="输入关键字进行过滤"
										  v-model="filterText">
										</el-input>
										
										 <el-button icon="el-icon-plus" type="primary" size="mini" @click="checkProcessFn()">添加</el-button>
									</div>
									
				  	  				
									<el-table
									    ref="multipleTable"
									    :data="processList"
										 @selection-change="handleSelectionChange"
									    tooltip-effect="dark"
									    style="width: 100%"
										height="288"
									 >
									    <el-table-column
									      type="selection"
									      width="55">
									    </el-table-column>
									    <el-table-column
									      label="名称"
										  sortable>
									      <template slot-scope="scope">{{ scope.row.taskName }}</template>
									    </el-table-column>
									    <el-table-column
									      prop="taskPid"
									      label="pid"
									      width="64"
										  sortable>
									    </el-table-column>
									    <el-table-column
									      prop="taskNec"
									      label="内存"
										  width="80"
									      sortable>
									    </el-table-column>
									  </el-table>

				  	  				</el-tree>
				  	  		</div>
				  	  	</div>
				  	  
				  	  	<div class="rightBox">
				  	  		<div class="rigBox transferk">
				  	  			<div class="right-title">
				  	  				<span>保障进程</span>
				  	  				<span class="btnSpan" @click="clearAll('pcml')" >重置</span>
				  	  			</div>
				  	  			<div class="rightcontent">
				  	  
				  	  				<el-scrollbar style="height: 100%;" wrap-class="list" wrap-style="overflow-x:auto;">
				  	  					<p class=" tipText" v-show="checkProcessList.length==0">点击同步复刻组快速匹配复刻组的配置或者
				  	  						点击左侧添加排除目录按钮，在弹框中选择路径点击添加</p>
				  	  					<div class="rightcontentUL">
				  	  						<div v-for="(data,index) in checkProcessList " :key="index" class="flexBox">
				  	  							<span class="marginLeft10 textSpanBox">{{ data.taskName }}</span>
				  	  							<i class="el-icon-delete pointer" @click="checkProcessList.splice(index, 1)"></i>
				  	  						</div>
				  	  					</div>
				  	  				</el-scrollbar>
				  	  			</div>
				  	  		</div>
				  	  	</div>
						<div class="rightBox">
							<div class="rigBox transferk">
								<div class="right-title">
									<span>保障进程目录</span>
									<span class="btnSpan" @click="clearAll('pcml')" >重置</span>
								</div>
								<div class="rightcontent">
										  	  
									<el-scrollbar style="height: 100%;" wrap-class="list" wrap-style="overflow-x:auto;">
										<p class=" tipText" v-show="checkProcessPahtList.length==0">点击同步复刻组快速匹配复刻组的配置或者
											点击左侧添加排除目录按钮，在弹框中选择路径点击添加</p>
										<div class="rightcontentUL">
											<div v-for="(data,index) in checkProcessPahtList " :key="index" class="flexBox">
												<i class="el-icon-folder-opened"></i> 
												<span class="marginLeft10 textSpanBox">{{ data.path }}</span>
												<i class="el-icon-delete pointer" @click="checkProcessList.splice(index, 1)"></i>
											</div>
										</div>
									</el-scrollbar>
								</div>
							</div>
						</div>
				  	  </div>
				
			  </el-tab-pane>
			  <el-tab-pane label="目录" name="2">
				  
				</el-tab-pane>
			</el-tabs> -->
				  <div class="pathBox">
				  	<div class="leftBox">
				  		<div class="lBox ">
				  			<el-form ref="form" label-width="110px">
				  				<el-form-item label="同步复刻组">
				  					<el-select v-model="value" @change="changeRepFn" placeholder="请选择参照的复刻任务">
				  						<el-option v-for="item in reprintTaskList" :key="item.id" :label="item.reprintName"
				  							:value="item.sysInfo">
				  						</el-option>
				  					</el-select>
				  				</el-form-item>
				  			</el-form>
				  
				  
				  			<div class=" elBtnMg25Div">
				  				<el-button type="primary" class="" @click="showDalog('fkml')">同步目录<i
				  						class="el-icon-arrow-right el-icon--right "></i></el-button>
				  				<el-button type="primary" class="" @click="showDalog('pcml')">排除目录<i
				  						class="el-icon-arrow-right el-icon--right "></i></el-button>
				  			</div>
				  		</div>
				  
				  		<div class="rightBox transferk">
				  			<div class="right-title">
				  				<span>同步目录和文件</span>
				  				<span class="btnSpan" @click="clearAll('fkml')" >重置</span>
				  			</div>
				  			<div class="rightcontent">
				  
				  				<el-scrollbar style="height: 100%;" wrap-class="list" wrap-style="overflow-x:auto;">
				  					<div class="rightcontentUL">
				  						<p class=" tipText" v-show="includePaths.length==0">点击同步复刻组快速匹配复刻组的配置或者
				  							点击左侧同步目录按钮，在弹框中选择路径点击添加</p>
				  						<div v-for="(data,index) in includePaths " :key="index" class="flexBox">
				  							<span class="marginLeft10 textSpanBox">{{ data.path }}</span>
				  							<i class="el-icon-delete pointer" @click="includePaths.splice(index, 1)"></i>
				  						</div>
				  					</div>
				  				</el-scrollbar>
				  			</div>
				  		</div>
				  	</div>
				  
				  	<div class="rightBox">
				  		<div class="rigBox transferk">
				  			<div class="right-title">
				  				<span>排除目录和文件</span>
				  				<span class="btnSpan" @click="clearAll('pcml')" >重置</span>
				  			</div>
				  			<div class="rightcontent">
				  
				  				<el-scrollbar style="height: 100%;" wrap-class="list" wrap-style="overflow-x:auto;">
				  					<p class=" tipText" v-show="copyExcludeFile.length==0">点击同步复刻组快速匹配复刻组的配置或者
				  						点击左侧添加排除目录按钮，在弹框中选择路径点击添加</p>
				  					<div class="rightcontentUL">
				  						<div v-for="(data,index) in copyExcludeFile " :key="index" class="flexBox">
				  							<span class="marginLeft10 textSpanBox">{{ data.path }}</span>
				  							<i class="el-icon-delete pointer" @click="copyExcludeFile.splice(index, 1)"></i>
				  						</div>
				  					</div>
				  				</el-scrollbar>
				  			</div>
				  		</div>
				  	</div>
				  </div>
		
		</div>
		 


		<div class="textCenter margin10">
			<el-button size="small" type="primary" plain @click="backPage">上一步</el-button>
			<el-button size="small" type="primary" @click="next">下一步</el-button>
		</div>

		<el-dialog title="目录选择" :visible.sync="dialogVisible" width="500px">
			<div class="transfer">
				<div class="left transferk">
					<el-scrollbar style="height: 100%;" wrap-class="list" wrap-style="overflow-x:hidden;">
						<el-tree :props="props" :load="getDiskPathFn" :data="pathData" lazy ref="nodeTree" show-checkbox
							node-key="pathAll"  :check-strictly="true">
							<span class="custom-tree-node" slot-scope="{ node, data }">
								<span>
									<i :class="data.icon"></i> <span class="marginLeft10">{{ data.path }}</span>
								</span>
							</span>
						</el-tree>
					</el-scrollbar>
				</div>
			</div>

			<span slot="footer" class="dialog-footer">
				<el-button class="refreshBtn" @click="getDiskPath">刷新<i class="el-icon-refresh"></i></el-button>
				<el-button type="primary" @click="addNode">添加<i class="el-icon-arrow-right el-icon--right"></i>
				</el-button>
				<el-button @click="dialogVisible = false">取 消</el-button>
			</span>
		</el-dialog>
	</div>
</template>

<script>
	import global_ from '@/utils/Global';
	import {
		listReprintTask,
	} from "@/api/console/reprintTask";

	import {
		diskPath,
		initDataStatus,
	} from "@/api/console/reprint";
	
	
	
	export default {
		props: {
			active: Number,
			fkSysType: String,
			formDatas: Object,
		},
		watch:{
			dialogVisible(newVal){
				if(!newVal){
					this.$refs.nodeTree.setCheckedKeys([]);
				}
			},
			fullTransferEnabled(newVal){
				if(!newVal){
					this.dataMonitorEnabled = false;
				}
			},
			dataMonitorEnabled(newVal){
				if(newVal){
					this.fullTransferEnabled = true;
				}
			},
		},
		data() {
			var vue = this;
			return {
				helpList: [{
						'title': '1.数据同步页面指引',
						'helpMsg': '数据同步页面指引',
					},
					{
						'title': '2.配置地址注意事项',
						'helpMsg': '配置地址注意事项',
					},
					{
						'title': '3.如何确定保障地址？',
						'helpMsg': '如何确定保障地址',
					},
				],
				//复刻目录和文件
				includePaths: [],
				//排除目录和文件
				copyExcludeFile: [],

				num: '',
				isExistenceDbConfig: false,
				props: {
					label: 'path',
					children: 'children',
					isLeaf: 'leaf'
				},
				//是否通过页面的判断逻辑
				isTraverse: false,
				dialogVisible: false,
				pathData: [],
				fullTransferEnabled: true,
				dataMonitorEnabled: true,
				options: [],
				value: '',
				reprintTaskList: [],
				defIncludePaths: [],
				defcopyExcludeFile: [],
				security: {
					id: '',
					hessGroupPaths: []
				},
				pageIndex: 1,
				activeName:'first',
				//进程目录
				processList:[ 
					{
					    "taskSession": "1",
					    "taskNec": "6,088K",
					    "taskPid": "408",
					    "taskName": "csrss.exe",
					    "taskSessionName": "Console"
					},
					{
					    "taskSession": "1",
					    "taskNec": "26,088K",
					    "taskPid": "2408",
					    "taskName": "222csrss.exe",
					    "taskSessionName": "Console"
					},
					{
					    "taskSession": "1",
					    "taskNec": "36,088K",
					    "taskPid": "3408",
					    "taskName": "33csrss.exe",
					    "taskSessionName": "Console"
					},
				],
				//进程目录过滤字段
				filterText:'',
				//已选择的进程列表
				checkProcessList:[],
				dataType:'1',
				selection:[],
				checkProcessPahtList:[],
			};
		},
		watch: {
		  filterText(val) {
			this.processList = this.processListNewArr.filter((obj)=>{
				if(obj.taskName.indexOf(val) != -1){
					return obj
				}
			});

		  }
		 },
		created() {
			this.getDictsFn();
			this.getList();
			if (this.formDatas.id) {
				this.initData();
			};
			
			
			
		},
		methods: {
			
			//初始化数据 回显编辑的默认数据
			initData() {
				var vue = this;
				this.activeNames = [];

				this.formDatas.hessGroupPaths.map((item) => {
					if (item.monitorType == 1) {
						this.includePaths.push(item)
					}

					if (item.monitorType == 2) {
						this.copyExcludeFile.push(item)
					}
				})

				this.defIncludePaths = JSON.parse(JSON.stringify(this.includePaths));
				this.defcopyExcludeFile = JSON.parse(JSON.stringify(this.copyExcludeFile));
				
				if(!this.formDatas.importantNodeId){
					this.formDatas.importantNodeId = this.getNodeId(this.formDatas.importantNodeIp);
				}
				this.getDiskPathFn({
					'id': this.formDatas.importantNodeId,
					'nodeIp': this.formDatas.importantNodeIp
				});
			},
			//数据重置
			clearAll(type) {
				if (type == 'fkml') {
					this.includePaths = JSON.parse(JSON.stringify(this.defIncludePaths));
				} else {
					this.copyExcludeFile = JSON.parse(JSON.stringify(this.defcopyExcludeFile));
				}

				this.$message({
					message: '已重置到默认数据',
					type: 'success'
				});
			},
	
	
			//显示磁盘目录弹框
			showDalog(type) {
				this.showDalogType = type;
				this.dialogVisible = true;
			},
			// 添加 节点
			addNode() {
				var NodeArr = this.$refs.nodeTree.getCheckedNodes();
				
				// console.log(this.showDalogType)
				NodeArr.map((item) => {
					var newItem = {};
					newItem = JSON.parse(JSON.stringify(item));
					var pathAll = JSON.stringify(newItem.pathAll.replace(/\\\\/g, '\\')) ;

					var str = pathAll.substr(pathAll.length - 1, pathAll.length);
					if (str == '\\' || str == "/") {
						pathAll = pathAll.substr(0, pathAll.length - 1);
					}
					
					
					if (this.showDalogType == 'fkml') {
						newItem.path = newItem.pathAll;
						newItem.monitorType = 1;

						this.includePaths.push(newItem);
					} else {
						newItem.monitorType = 2;
						newItem.path = newItem.pathAll;
						this.copyExcludeFile.push(newItem);
					}
				})

				if (this.showDalogType == 'fkml') {
					this.includePaths = this.removeDuplicate(this.includePaths);
					this.checkSubset(this.includePaths);
				} else {
					this.copyExcludeFile = this.removeDuplicate(this.copyExcludeFile);
					this.checkSubset(this.copyExcludeFile);
				}
				this.$refs.nodeTree.setCheckedKeys([]);
			},
			//检查 是否有不同的元素 
			checkIdentical(oldArr, newArr) {

				//处理完成后返回的数组
				var resArr = [];
				for (var i = 0, len = oldArr.length; i < len; i++) {
					var isIdentical = false;
					for (var p = 0, lenP = newArr.length; p < lenP; p++) {
						if (oldArr[i].entryPath == '' || oldArr[i].entryPath == newArr[p].entryPath) {
							
							//判断只要有一个相同的后面的就不用
							isIdentical = true;
							break
						}
					}
					if (!isIdentical) {
						resArr.push(oldArr[i]);
					}
				}
				//返回不同元素和新
				return resArr.concat(newArr);
			},
			//检查 是否有子集
			checkSubset(dataArr) {
				
				var isSunset = false;
				for (let i = 0, len = dataArr.length; i < len; i++) {
					if (dataArr[i].type != 3) {
						for (let i2 = 0, len2 = dataArr.length; i2 < len2; i2++) {
							if (dataArr[i].path != dataArr[i2].path && dataArr[i].path == dataArr[i2].path.slice(0,dataArr[i].path.length)) {
								// console.log(dataArr[i].pathAll ,'-------------', dataArr[i2].pathAll )
								isSunset = true;
								
								if(dataArr[i].pathAll && dataArr[i2].pathAll){
									var A = dataArr[i].pathAll.split('\\');
									var B = dataArr[i2].pathAll.split('\\');
									// console.log(A ,'-------333------', B )
									if(A.length == B.length){
										if(A[A.length-2] == B[B.length-2]){
											isSunset = false;
										}
									}
								}
							}
							
							if(dataArr[i].path == dataArr[i2].path && i != i2){
								isSunset = true;
							}
						};
					}
				}
				if (isSunset) {
					this.$confirm('检测到当前可能存在子目录重复选择，是否启动自动过滤?', '提示', {
						confirmButtonText: '确定',
						cancelButtonText: '取消',
						type: 'warning'
					}).then(() => {
						this.filterSubset(dataArr);
					}).catch(() => {
						this.dialogVisible = false;
					});
				} else {
					this.dialogVisible = false;
				}
			},
			//数据去重
			removeDuplicate(arr,filterField='path') {
				let newArr = arr.reduce((pre,cur) => pre.some(item => item[filterField] == cur[filterField]) ?
				pre : [...pre,cur],[])
				return newArr
			},
			//过滤多余子集 只保留父级
			filterSubset(dataArr) {

				var addArr = this.removeDuplicate(dataArr);
				//替换数组索引
				var fIndexArr = [];
				for (let i = 0, len = dataArr.length; i < len; i++) {
					for (let i2 = 0, len2 = dataArr.length; i2 < len2; i2++) {
						if (dataArr[i].path != dataArr[i2].path && dataArr[i].path.indexOf(dataArr[i2].path) != -1) {
								var isSunset = true;
								if(dataArr[i].pathAll && dataArr[i2].pathAll){
									var A = dataArr[i].pathAll.split('\\');
									var B = dataArr[i2].pathAll.split('\\');
									// console.log(A ,'-------333------', B )
									if(A.length == B.length){
										if(A[A.length-2] == B[B.length-2]){
											isSunset = false;
										}
									}
								}
								if(isSunset){
									fIndexArr.push(i)
								}
						}
					}
				}
				// console.log(fIndexArr);
				//将重复的索引位置数据情空
				for (let i3 = 0, len3 = fIndexArr.length; i3 < len3; i3++) {
					addArr[fIndexArr[i3]] = '';
				}

				//将有数据的加入新数组
				var newArr = [];
				for (let i4 = 0, len4 = addArr.length; i4 < len4; i4++) {
					if (addArr[i4]) {
						newArr.push(addArr[i4]);
					}
				}
				
				
				
				//根据选择的添加
				if (this.showDalogType == 'fkml') {
					this.includePaths = newArr;

				} else {
					this.copyExcludeFile = newArr;
				}
				this.dialogVisible = false;
			},
			//通过循环从 IP 解析出原来的ID
			getNodeId(ip){
				var id = "";
				for(let item in this.formDatas.hessNodes){
					if(this.formDatas.hessNodes[item].nodeIp == ip){
						id = this.formDatas.hessNodes[item].id;
					}
				}
				return id;
			},
			//刷新目录数据
			getDiskPath() {
				
				if(!this.formDatas.importantNodeId){
					this.formDatas.importantNodeId = this.getNodeId(this.formDatas.importantNodeIp);
				}
				
				this.getDiskPathFn({
					'id': this.formDatas.importantNodeId,
					'nodeIp': this.formDatas.importantNodeIp
				});
			},
			//获取node节点的 文件目录信息
			getDiskPathFn(node, resolve) {
				var vue = this;
				if (node.level === 0) {
					return resolve(this.pathData);
				}

				if (node.data && node.data.path) {
					this.nodeInfo.params = {
						"diskPath": node.data.pathAll
					};
				} else {
					this.nodeInfo = node;
					this.nodeInfo.params = {
						"diskPath": ""
					};
				}
				if (!resolve) {
					this.$message({
						message: '正在查询子目录文件...',
						type: 'info',
						duration: 1500,
					});
				}
				//去除多余的 “////” 添加文件类型的图标
				diskPath(this.nodeInfo).then(response => {
					if (response.data) {
						/**类型，1盘符， 2目录，3文件*/
						response.data = response.data.map((item) => {
							item.pathAll = item.pathAll.replace(/\\\\/g, '\\');

							if (item.type == 3) {
								item.leaf = true;
								item.icon = 'el-icon-document'
							} else if (item.type == 2) {
								item.icon = 'el-icon-folder-opened'
							} else {
								item.icon = 'el-icon-monitor'
							}

							return item;
						})

						if (resolve) {
							resolve(response.data);
						} else {

							if (response.data.length == 0) {
								this.$message({
									message: '未查询到关联子目录或文件',
									type: 'warning'
								});
							}

							vue.pathData = response.data;
						}
					} else {
						this.allChackNode = [];
						if (resolve) {
							resolve(this.allChackNode);
						} else {
							vue.pathData = [];
						}

						this.$message({
							message: '未查询到关联子目录或文件',
							type: 'warning'
						});
					}

				});
			},
			//处理页面数据
			processingData() {
				let type = true;
				if (this.dataMonitorEnabled && this.includePaths.length < 1) {
					
					this.$confirm('开启增量复刻后，请配置复刻目录或文件!', '警告', {
						confirmButtonText: '确定',
						cancelButtonText: '取消',
						type: 'warning'
					}).then(() => {
						
					})	
					
					type = false;
				}
				return type;
			},
			getDictsFn() {
				//业务配置-配置类型
				this.getDicts('group_sysc_type').then(response => {
					this.group_sysc_type_options = response.data;
				})
			},
			//上一步
			backPage() {
				this.$emit('changeActive', 2);
			},

			//下一步
			next(resolveIndex) {
				var vue = this;
				if (vue.processingData()) {
					console.log(vue.formDatas)
					vue.security.id = vue.formDatas.id;
					vue.security.hessGroupPaths = this.includePaths.concat(this.copyExcludeFile)
					vue.security.dataMonitorEnabled = vue.dataMonitorEnabled;
					vue.security.fullTransferEnabled = vue.fullTransferEnabled;

					if (typeof resolveIndex == 'function') {
						resolveIndex(true);
					} else if (!vue.dataMonitorEnabled && vue.includePaths.length > 0 && vue.pageIndex != 1) {

						this.$confirm('未配置开启, 后续操作将不再启用数据同步，是否开启?', '提示', {
							confirmButtonText: '开启',
							cancelButtonText: '放弃',
							type: 'warning'
						}).then(() => {
							vue.dataMonitorEnabled = true;
							this.jumpPage();
						}).catch(() => {
							this.jumpPage();
						});
					} else {
						vue.pageIndex++
						this.jumpPage();
					}
				}
			},
			//跳转页面
			jumpPage() {
				var vue = this;
				if (vue.dataMonitorEnabled && vue.pageTyle == 'edit') {
					initDataStatus(vue.security).then(response => {
						if (response.data.flag === true) {
							vue.$alert(
								'<i class="el-icon-warning" style="color:#E6A23C;font-size:22px;margin-top: 15px;"></i><div style="margin-left:32px;margin-top:-36px">保障地址已发生变化，配置完成后请点击“数据同步”按钮进行数据同步初始化！</div>',
								'提示', {
									dangerouslyUseHTMLString: true,
									confirmButtonText: '确定',
									callback: action => {

									}
								});
						}
					})
				}
				// console.log('数据查看：', vue.security.hessGroupPaths);
				vue.security.dataMonitorEnabled = vue.dataMonitorEnabled;
				vue.$emit('changeActive', 4, vue.security, '', vue.activeIndex);
			},
			
			
			
			
			//添加选择节点到保障进程目录
			checkProcessFn(){
				console.log(this.selection);
				//利用set 来过滤重复数据
				var set = new Set();
				
				var newArr = this.checkProcessList.concat(this.selection)
				
				newArr.forEach((value, key) => {
					set.add( JSON.stringify(value));
				});
				
				this.checkProcessList = Array.from(set).map((item)=>{
					return JSON.parse(item)
				});
				this.addTaskPathFm()
			},
			
			addTaskPathFm(){
				this.checkProcessPahtList.push({
					'path':"C:\\Windows\\system32\\",
				})
			},
			//勾选进程列表数据
			handleSelectionChange(selection){
				this.selection = selection;
			},
			//通过关键字过滤树节点
			filterNode(value, data) {
				if (!value) return true;
				return data.label.indexOf(value) !== -1;
			  },
			/** 查询复刻任务列表 */
			getList(isQuery) {
				listReprintTask({
					pgNum: 1,
					pgSize: 10000,
					reprintName: null,
					nodeId: null,
					targetNodeId: null,
					taskStatus: null,
					nodeInfoId: null,
				}).then(response => {
					this.reprintTaskList = [];
					response.rows.map((item) => {
						if (JSON.parse(item.sysInfo).increment) {
							this.reprintTaskList.push(item);
						}
					});
				});
			},
			//将复刻组中的 同步目录和排除目录 一起迁移到 保障组
			changeRepFn() {
				var data = JSON.parse(this.value);
				this.includePaths = data.includePaths.map((item) => {
					item.monitorType = 1;
					item.path = item.pathAll;
					return item;
				});
				// console.log(this.includePaths)
				this.copyExcludeFile = data.copyExcludeFile.map((item) => {
					item.monitorType = 2;
					item.path = item.pathAll;
					return item;
				});
			},
			//
			dataTypeFn(){
				if(this.dataType == 2){
					this.activeName = 'second';
				}
			},
		}
	}
</script>
<style>
	#step4 .el-dialog__body {
		padding: 4px 20px;
	}
</style>
<style lang="scss" scoped>
	.topBox {
		height: 40px;
		line-height: 40px;
	}

	.refreshBtn {
		float: left;
		margin-left: 10px;
	}

	.tableBox {
		width: 1150px;
		margin: 0 auto;
		text-align: left;
	}

	.margin10 {
		margin: 10px;
	}

	.configBox {
		margin-top: 16px;
	}

	.seniorSpan {
		position: absolute;
		top: -4px;
	}

	.tltleBoxR {
		width: 120px;
		position: relative;
	}

	.tipTxt {
		color: #626060;
		font-size: 14px;
		display: inline-block;
		margin-bottom: 6px;
		margin-top: 0px;
	}

	.error {
		color: #F56C6C;
		margin-right: 10px;
	}

	.pathBox {
		margin-top: 15px;
		display: flex;
		justify-content: center;
	}

	.pathBox>div {
		display: flex;

	}

	.pathBox>div>div {
		flex: 1;
	}

	.transferk {
		width: 100%;
		min-width: 320px;
		height: 340px;
		border: 1px solid #ebeef5;
		border-radius: 4px;
		background: #fff;
		display: inline-block;
		vertical-align: middle;
		max-height: 100%;
		position: relative;
	}

	.right-title {
		height: 40px;
		line-height: 40px;
		background: #f5f7fa;
		margin: 0;
		padding-left: 15px;
		border-bottom: 1px solid #ebeef5;
		box-sizing: border-box;
		color: #666;
		font-weight: bold;
		font-size: 14px;
	}

	.rightcontent {
		margin-right: 1px;
		height: 280px;
	}

	.rightcontentUL {
		height: 300px;
	}


	.marginLeft10 {
		margin-left: 10px;
	}

	.flexBox {
		display: flex;
		padding: 5px 10px;
	}

	.btnSpan {
		color: #0599cc;
		float: right;
		margin-right: 10px;
		cursor: pointer;
		font-size: 14px;
		font-weight: 500;
	}

	.textSpanBox {
		word-wrap: break-word;
		word-break: break-all;
		width: 270px;
		padding-right: 10px;
	}

	.tipText {
		width: 280px;
		margin-left: 10px;
		color: #8f8f8f;
		font-size: 15px;
	}

	.conBox {
		margin: 10px;
		margin-top: 170px;
	}

	.rightBox {
		margin-left: 20px;
	}
	
	.inlinBlock{
		display: inline-block;
		margin-right: 10px;
	}
	.w240{
		width: 240px;
	}
	.elBtnMg25Div{
		text-align: right;
	}
	.treeBox {
		padding: 10px;
	}
	.treeBox .elIpt{
		width: 200px;
		margin-right: 20px;
	}
	.miniTabDiv{
		width: 380px;
	}
</style>
<style>
	.miniTabDiv .el-table__row td{
		padding: 0;
	}
	.miniTabDiv .has-gutter th{
		padding: 0;
	}
</style>